package com.nineclock.approve.resolver.impl;

import cn.hutool.json.JSONObject;
import com.nineclock.approve.resolver.ProcessNodeResolver;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.StartEvent;

/**
 * 开始节点流程处理器
 */
public class StartNodeResolver extends ProcessNodeResolver {
    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {
        StartEvent startEvent=new StartEvent();
        startEvent.setId(getNodeId(currNode));
        startEvent.setName(currNode.getStr("name"));

        process.addFlowElement(startEvent);

        //绘制线条, 指向下一个节点
        newSequenceFlow(process, currNode, nextNode);
    }
}
